// index.js
// 获取应用实例
const app = getApp()
import { request } from "../request/index"
Page({
  data: {
    swiperlist: [],
    catelist:[],
    floorlist:[]
  },
  //页面开始加载就会触发
  onLoad(options) {
    this.getSwiperList();
    this.getCateList();
    this.getFloorList();
  },
  getSwiperList(){
    request({
      url: "/home/swiperdata"
    }).then(result => {
      this.setData({
        swiperlist: result
      })
    })
  },
  getCateList(){
    request({
      url: "/home/catitems"
    }).then(result => {
      this.setData({
        catelist: result
      })
    })
  },
  getFloorList(){
    request({
      url: "/home/floordata"
    }).then(result => {
      this.setData({
        floorlist: result
      })
    })
  }
})
